package com.guomei.mapper.curse;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.guomei.bean.curse.domain.UserDistributorCourseRel;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 用户-招生老师-课程关系Mapper
 */
@Mapper
public interface UserDistributorCourseRelMapper extends BaseMapper<UserDistributorCourseRel> {
    
    /**
     * 根据学生ID查询关系
     */
    List<UserDistributorCourseRel> selectByStudentId(@Param("studentId") Long studentId);

    /**
     * 根据招生老师ID查询关系
     */
    List<UserDistributorCourseRel> selectByDistributorId(@Param("distributorId") Long distributorId);

    /**
     * 根据课程ID查询关系
     */
    List<UserDistributorCourseRel> selectByCourseId(@Param("courseId") Long courseId);

    /**
     * 根据订单ID查询关系
     */
    List<UserDistributorCourseRel> selectByOrderId(@Param("orderId") Long orderId);

    /**
     * 根据学生ID和课程ID查询关系
     */
    UserDistributorCourseRel selectByStudentAndCourse(@Param("studentId") Long studentId, @Param("courseId") Long courseId);

    /**
     * 根据学生ID、招生老师ID和课程ID查询关系
     */
    UserDistributorCourseRel selectByStudentDistributorAndCourse(@Param("studentId") Long studentId,
                                                                 @Param("distributorId") Long distributorId,
                                                                 @Param("courseId") Long courseId);
}
